home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 24.0 KB | 846 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: CMovie.cpp
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef CMOVIE_H
- #include "CMovie.h"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWMEMMGR_H
- #include "FWMemMgr.h"
- #endif
-
- #ifndef FWFILESP_H
- #include "FWFileSp.h"
- #endif
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWFRAME_H
- #include "FWFrame.h"
- #endif
-
- #ifndef FWEVENT_H
- #include "FWEvent.h"
- #endif
-
- #ifndef FWACQUIR_H
- #include "FWAcquir.h"
- #endif
-
- #ifndef FWMEMHLP_H
- #include "FWMemHlp.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_ODFacet_xh
- #include <Facet.xh>
- #endif
-
- #ifndef SOM_ODWindow_xh
- #include <Window.xh>
- #endif
-
- #ifndef SOM_ODFrame_xh
- #include <Frame.xh>
- #endif
-
- // ----- Platform Includes -----
-
- #if defined(FW_BUILD_MAC) && !defined(__GESTALTEQU__)
- #include <GestaltEqu.h>
- #endif
-
- //========================================================================================
- // Runtime informations
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment odfmovie
- #endif
-
- //========================================================================================
- // CMovie static methods
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // CMovie::InitializeQuickTime
- //----------------------------------------------------------------------------------------
-
- FW_Boolean CMovie::InitializeQuickTime()
- {
- short error;
- long result;
-
- error = ::Gestalt(gestaltQuickTime, &result);
-
- if (error == noErr)
- {
- EnterMovies(); // THROW_IF_ERROR
- return TRUE;
- }
- else
- return FALSE;
-
- // else
- // THROW_IF_ERROR(envNotPresent, "MoviePart:Init:Quicktime not available");
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::TerminateQuickTime
- //----------------------------------------------------------------------------------------
-
- void CMovie::TerminateQuickTime()
- {
- ExitMovies();
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::NewMovieFromFile
- //----------------------------------------------------------------------------------------
-
- CMovie* CMovie::CreateNewMovieFromFile(const FW_CFileSpecification& movieFile)
- {
- Movie newMovie = NULL;
- short movieResFile;
- short movieResID;
- Str255 movieName;
- FW_Boolean wasChanged;
- FSSpec movieFileSpec;
-
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
-
- movieFile.MacGetFSSpec(movieFileSpec);
- OSErr err = ::OpenMovieFile(&movieFileSpec, &movieResFile, fsRdPerm); // THROW_IF_ERROR
- if (err == noErr)
- {
- movieResID = 0; // First movie found
- err = ::NewMovieFromFile(&newMovie, movieResFile,
- &movieResID,
- movieName, newMovieActive,
- &wasChanged); // THROW_IF_ERROR
- ::CloseMovieFile(movieResFile); // THROW_IF_ERROR
- }
- }
-
- return (newMovie != NULL) ? FW_NEW(CMovie, (newMovie)) : NULL;
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::CreateNewMovieFromHandle
- //----------------------------------------------------------------------------------------
-
- CMovie* CMovie::CreateNewMovieFromHandle(FW_PlatformHandle movieHandle)
- {
- Movie newMovie = NULL;
- FW_Boolean dataRefChanged;
-
- if (movieHandle)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::NewMovieFromHandle(&newMovie, movieHandle, newMovieActive, &dataRefChanged); // THROW_IF_ERROR
- }
-
- return FW_NEW(CMovie, (newMovie));
- }
-
- //========================================================================================
- // class CMovie
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // CMovie::CMovie
- //----------------------------------------------------------------------------------------
-
- CMovie::CMovie() :
- fMovie(NULL),
- fMovieController(NULL)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::CMovie
- //----------------------------------------------------------------------------------------
-
- CMovie::CMovie(Movie theAdoptedMovie) :
- fMovie(theAdoptedMovie),
- fMovieController(NULL)
- {
- FW_SPlatformRect movieBox;
- ::GetMovieBox(fMovie, &movieBox);
-
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- fMovieController = ::NewMovieController(fMovie, &movieBox, mcTopLeftMovie+mcWithBadge+mcNotVisible);
- FW_ASSERT(fMovieController != NULL);
- }
-
- ::MCDoAction(fMovieController, mcActionSetUseBadge, (Ptr)FALSE);
-
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::CMovie
- //----------------------------------------------------------------------------------------
-
- CMovie::CMovie(const CMovie& other) :
- fMovie(NULL),
- fMovieController(NULL)
- {
- TimeValue currentTime, duration;
-
- other.GetCurrentSelection(¤tTime, &duration);
- ((CMovie&)other).SelectAll();
- fMovie = ((CMovie&)other).CopySelection();
- ((CMovie&)other).SetCurrentSelection(currentTime, duration);
-
- if (fMovie)
- {
- FW_SPlatformRect movieBox;
- ::GetMovieBox(fMovie, &movieBox);
-
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- fMovieController = ::NewMovieController(fMovie, &movieBox, mcTopLeftMovie+mcWithBadge+mcNotVisible);
- FW_ASSERT(fMovieController != NULL);
- }
-
- ::MCDoAction(fMovieController, mcActionSetUseBadge, (Ptr)FALSE);
- }
-
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::operator=
- //----------------------------------------------------------------------------------------
-
- CMovie& CMovie::operator=(const CMovie& other)
- {
- if (this == &other)
- return *this;
-
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::DisposeMovieController(fMovieController);
- fMovieController = NULL;
- }
-
- if (fMovie)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::DisposeMovie(fMovie);
- fMovie = NULL;
- }
-
- FW_Boolean dataRefChanged;
- FW_PlatformHandle movieHandle = FW_CMemoryManager::AllocateSystemHandle(0);
- FW_ASSERT(movieHandle != NULL);
-
- ::PutMovieIntoHandle(other.fMovie, movieHandle); // THROW_IF_ERROR
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::NewMovieFromHandle(&fMovie, movieHandle, newMovieActive, &dataRefChanged); // THROW_IF_ERROR
- }
-
- FW_CMemoryManager::FreeSystemHandle(movieHandle);
-
- if (fMovie)
- {
- FW_SPlatformRect movieBox;
- ::GetMovieBox(fMovie, &movieBox);
-
- fMovieController = ::NewMovieController(fMovie, &movieBox, mcTopLeftMovie+mcWithBadge+mcNotVisible);
- FW_ASSERT(fMovieController != NULL);
-
- ::MCDoAction(fMovieController, mcActionSetUseBadge, (Ptr)FALSE);
-
- FW_Boolean enabled;
-
- ::MCDoAction(other.fMovieController, mcActionGetKeysEnabled, &enabled);
- ::MCDoAction(fMovieController, mcActionSetKeysEnabled, (Ptr)enabled);
-
- ::MCDoAction(other.fMovieController, mcActionGetDragEnabled, &enabled);
- ::MCDoAction(fMovieController, mcActionSetDragEnabled, (Ptr)enabled);
-
- ::MCEnableEditing(fMovieController, (::MCIsEditingEnabled(other.fMovieController) != 0));
- }
-
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::~CMovie
- //----------------------------------------------------------------------------------------
-
- CMovie::~CMovie()
- {
- FW_START_DESTRUCTOR
-
- FW_CMacAcquireMultiFinderHeapZone heapZone;
-
- if (fMovieController)
- {
- ::DisposeMovieController(fMovieController);
- fMovieController = NULL;
- }
-
- if (fMovie)
- {
- ::DisposeMovie(fMovie);
- fMovie = NULL;
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::MakeControllerVisible
- //----------------------------------------------------------------------------------------
-
- void CMovie::MakeControllerVisible(FW_Boolean visible)
- {
- if (fMovieController)
- ::MCSetVisible(fMovieController, visible); // THROW_IF_ERROR
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::GetBoundingBox
- //----------------------------------------------------------------------------------------
-
- void CMovie::GetBoundingBox(FW_CRect& boundingBox)
- {
- FW_SPlatformRect movieBox;
-
- if (fMovieController && ::MCGetVisible(fMovieController))
- ::MCGetControllerBoundsRect(fMovieController, &movieBox);
- else if (fMovie)
- ::GetMovieBox(fMovie, &movieBox);
-
- boundingBox = movieBox;
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::SetBoundingBox
- //----------------------------------------------------------------------------------------
-
- void CMovie::SetBoundingBox(const FW_CRect& boundingBox)
- {
- FW_SPlatformRect movieBox;
- boundingBox.AsPlatformRect(movieBox);
-
- if (fMovieController && ::MCGetVisible(fMovieController))
- ComponentResult error = ::MCSetControllerBoundsRect(fMovieController, &movieBox); // THROW_IF_ERROR
- else if (fMovie)
- ::SetMovieBox(fMovie, &movieBox);
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::SetGraphicsWorld
- //----------------------------------------------------------------------------------------
-
- void CMovie::SetGraphicsWorld(ODPlatformWindow platformWindow)
- {
- if (fMovie)
- ::SetMovieGWorld(fMovie,(CGrafPtr)platformWindow, NULL);
-
- if (fMovieController)
- ::MCSetControllerPort(fMovieController,(CGrafPtr)platformWindow);
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::SetClipShape
- //----------------------------------------------------------------------------------------
-
- void CMovie::SetClipShape(ODRgnHandle clipRegion)
- {
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
-
- FW_SPlatformRect movieBox, controllerBox;
- ::GetMovieBox(fMovie, &movieBox);
- ::MCGetControllerBoundsRect(fMovieController, &controllerBox);
-
- controllerBox.top = movieBox.bottom;
- ODRgnHandle tempRgn = ::NewRgn();
- ::RectRgn(tempRgn, &controllerBox); // controller region
-
- ::DiffRgn(clipRegion, tempRgn, tempRgn);
-
- ::MCSetClip(fMovieController, clipRegion, tempRgn); // THROW_IF_ERROR
-
- ::DisposeRgn(tempRgn);
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::Draw
- //----------------------------------------------------------------------------------------
-
- void CMovie::Draw(ODPlatformWindow platformWindow)
- {
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::MCDraw(fMovieController, platformWindow);
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::Idle
- //----------------------------------------------------------------------------------------
-
- void CMovie::Idle()
- {
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::MCIdle(fMovieController);
- }
- }
-
- //---------------------------------------------------------------------------------------
- // CMovie::DoMouseDown
- //----------------------------------------------------------------------------------------
-
- FW_Boolean CMovie::DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent)
- {
- FW_Boolean eventHandled = FALSE;
-
- if (fMovieController)
- {
- ODFacet* facet = theMouseEvent.GetFacet(ev);
-
- FW_CPoint where = theMouseEvent.GetMousePosition(ev, FW_CMouseEvent::kFrame);
- FW_CFrame *frame = FW_CFrame::ODtoFWFrame(ev, facet->GetFrame(ev));
- frame->GetContentView(ev)->FrameToViewContent(ev, where);
-
- FW_SPlatformPoint plfmPoint;
- where.AsPlatformPoint(plfmPoint);
-
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- eventHandled = (FW_Boolean)::MCClick(fMovieController, facet->GetWindow(ev)->GetPlatformWindow(ev),
- plfmPoint, theMouseEvent.GetTime(), theMouseEvent.GetModifiers());
- }
-
- return eventHandled;
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::DoVirtualKeyDown
- //----------------------------------------------------------------------------------------
-
- FW_Boolean CMovie::DoVirtualKeyDown(Environment* ev, const FW_CVirtualKeyEvent& theVirtualKeyEvent)
- {
- FW_Boolean eventHandled = FALSE;
-
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- eventHandled = (FW_Boolean)::MCKey(fMovieController,
- (char)theVirtualKeyEvent.GetMessage(), theVirtualKeyEvent.GetModifiers());
- }
-
- return eventHandled;
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::Activate
- //----------------------------------------------------------------------------------------
- void CMovie::Activate(ODPlatformWindow platformWindow, FW_Boolean activate)
- {
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::MCActivate(fMovieController, platformWindow, activate);
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::Start
- //----------------------------------------------------------------------------------------
- void CMovie::Start()
- {
- if (fMovieController)
- {
- Fixed playRate = ::GetMoviePreferredRate(fMovie);
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::MCDoAction(fMovieController, mcActionPlay, (Ptr)playRate);
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::Stop
- //----------------------------------------------------------------------------------------
-
- void CMovie::Stop()
- {
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::MCDoAction(fMovieController, mcActionPlay, (Ptr)0);
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::SetLooping
- //----------------------------------------------------------------------------------------
-
- void CMovie::SetLooping(FW_Boolean loop)
- {
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::MCDoAction(fMovieController, mcActionSetLooping, (Ptr)loop);
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::EnableKeys
- //----------------------------------------------------------------------------------------
-
- void CMovie::EnableKeys(FW_Boolean enable)
- {
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::MCDoAction(fMovieController, mcActionSetKeysEnabled, (Ptr)enable);
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::EnableEditing
- //----------------------------------------------------------------------------------------
-
- void CMovie::EnableEditing(FW_Boolean enable)
- {
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::MCEnableEditing(fMovieController, enable);
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::EnableDragging
- //----------------------------------------------------------------------------------------
-
- void CMovie::EnableDragging(FW_Boolean enable)
- {
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::MCDoAction(fMovieController, mcActionSetDragEnabled, (Ptr)enable);
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::IsLooping
- //----------------------------------------------------------------------------------------
-
- FW_Boolean CMovie::IsLooping()
- {
- FW_Boolean enabled = FALSE;
-
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::MCDoAction(fMovieController, mcActionGetLooping, (Ptr)enabled);
- }
-
- return enabled;
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::AreKeysEnabled
- //----------------------------------------------------------------------------------------
-
- FW_Boolean CMovie::AreKeysEnabled()
- {
- FW_Boolean enabled = FALSE;
-
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::MCDoAction(fMovieController, mcActionGetKeysEnabled, (Ptr)enabled);
- }
-
- return enabled;
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::IsEditingEnabled
- //----------------------------------------------------------------------------------------
-
- FW_Boolean CMovie::IsEditingEnabled()
- {
- FW_Boolean enabled = FALSE;
-
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- enabled = ::MCIsEditingEnabled(fMovieController) != 0;
- }
-
- return enabled;
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::IsDragEnabled
- //----------------------------------------------------------------------------------------
-
- FW_Boolean CMovie::IsDragEnabled()
- {
- FW_Boolean enabled = FALSE;
-
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::MCDoAction(fMovieController, mcActionGetDragEnabled, (Ptr)enabled);
- }
-
- return enabled;
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::IsPlaying
- //----------------------------------------------------------------------------------------
-
- FW_Boolean CMovie::IsPlaying()
- {
- FW_Boolean playing = FALSE;
- Fixed playRate;
-
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::MCDoAction(fMovieController, mcActionGetPlayRate, &playRate);
- playing = playRate != 0;
- }
-
- return playing;
- }
-
- //------------------------------------------------------------------------------
- // CMovie::GetCurrentSelection
- //------------------------------------------------------------------------------
-
- void CMovie::GetCurrentSelection(TimeValue* currentTime, TimeValue* duration) const
- {
- if (fMovie)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::GetMovieSelection(fMovie, currentTime, duration);
- }
- }
-
- //------------------------------------------------------------------------------
- // CMovie::SetCurrentSelection
- //------------------------------------------------------------------------------
-
- void CMovie::SetCurrentSelection(TimeValue currentTime, TimeValue duration)
- {
- if (fMovie)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::SetMovieSelection(fMovie, currentTime, duration);
- ::MCMovieChanged(fMovieController, fMovie); // THROW_IF_ERROR
- }
- }
-
- //------------------------------------------------------------------------------
- // CMovie::ClearCurrentSelection
- //------------------------------------------------------------------------------
-
- void CMovie::ClearCurrentSelection()
- {
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::MCClear(fMovieController); // THROW_IF_ERROR
- }
- }
-
- //------------------------------------------------------------------------------
- // CMovie::ClearSelection
- //------------------------------------------------------------------------------
-
- void CMovie::ClearSelection(TimeValue currentTime, TimeValue duration)
- {
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- this->SetCurrentSelection(currentTime, duration);
- ::MCClear(fMovieController); // THROW_IF_ERROR
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::CloseSelection
- //----------------------------------------------------------------------------------------
-
- void CMovie::CloseSelection()
- {
- this->SetCurrentSelection(0, 0);
- }
-
- //------------------------------------------------------------------------------
- // CMovie::IsSelectionEmpty
- //------------------------------------------------------------------------------
- FW_Boolean CMovie::IsSelectionEmpty()
- {
- FW_Boolean empty = TRUE;
-
- if (fMovie)
- {
- TimeValue currentTime, duration;
- this->GetCurrentSelection(¤tTime, &duration);
- empty = duration == (TimeValue)0;
- }
- return empty;
- }
-
- //------------------------------------------------------------------------------
- // CMovie::SelectAll
- //------------------------------------------------------------------------------
- void CMovie::SelectAll()
- {
- this->SetCurrentSelection((TimeValue)0, ::GetMovieDuration(fMovie));
- }
-
- //------------------------------------------------------------------------------
- // CMovie::CopySelection
- //------------------------------------------------------------------------------
- Movie CMovie::CopySelection()
- {
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- return ::MCCopy(fMovieController);
- }
- else
- return NULL;
- }
-
- //------------------------------------------------------------------------------
- // CMovie::CopyCurrentSelectionToHandle
- //------------------------------------------------------------------------------
- FW_PlatformHandle CMovie::CopyCurrentSelectionToHandle()
- {
- FW_PlatformHandle movieHandle = NULL;
- if (fMovieController)
- {
- Movie newMovie;
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- newMovie = ::MCCopy(fMovieController);
- }
-
- movieHandle = ::FW_CMemoryManager::AllocateSystemHandle(0);
- FW_ASSERT(movieHandle != NULL);
-
- ::PutMovieIntoHandle(newMovie, movieHandle); // THROW_IF_ERROR
-
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::DisposeMovie(newMovie);
- }
- }
- return movieHandle;
- }
-
- //------------------------------------------------------------------------------
- // CMovie::GetAsHandle
- //------------------------------------------------------------------------------
- FW_PlatformHandle CMovie::GetAsHandle()
- {
- FW_PlatformHandle movieHandle = NULL;
-
- if (fMovie)
- {
- movieHandle = FW_CMemoryManager::AllocateSystemHandle(0); // THROW_IF_NULL
- FW_ASSERT(movieHandle != NULL);
- ::PutMovieIntoHandle(fMovie, movieHandle); // THROW_IF_ERROR
- }
-
- return movieHandle;
- }
-
- //------------------------------------------------------------------------------
- // CMovie::GetAsPict
- //------------------------------------------------------------------------------
- FW_PlatformPict CMovie::GetAsPict()
- {
- FW_PlatformPict moviePict = NULL;
- if (fMovie)
- moviePict = ::GetMoviePict(fMovie, ::GetMovieTime(fMovie, NULL));
- return moviePict;
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::PasteMovieToSelection
- //----------------------------------------------------------------------------------------
- void CMovie::PasteMovieToSelection(CMovie* newMovie, TimeValue currentTime, TimeValue duration)
- {
- if (fMovieController)
- {
- this->SetCurrentSelection(currentTime, duration);
- this->PasteMovieToCurrentSelection(newMovie);
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::PasteMovieToCurrentSelection
- //----------------------------------------------------------------------------------------
- void CMovie::PasteMovieToCurrentSelection(CMovie* newMovie)
- {
- if (fMovieController)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::AddMovieSelection(fMovie, *newMovie);
- ::MCMovieChanged(fMovieController, fMovie);
- // ::MCPaste(fMovieController, *newMovie); // THROW_IF_ERROR
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::PasteHandleToSelection
- //----------------------------------------------------------------------------------------
- void CMovie::PasteHandleToSelection(FW_PlatformHandle newHandle, OSType handleType, TimeValue currentTime, TimeValue duration)
- {
- if (fMovie)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- this->SetCurrentSelection(currentTime, duration);
- ::PasteHandleIntoMovie(newHandle, handleType, fMovie, 0, (ComponentInstance)0); // THROW_IF_ERROR
- ::MCMovieChanged(fMovieController, fMovie); // THROW_IF_ERROR
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMovie::PasteHandleToCurrentSelection
- //----------------------------------------------------------------------------------------
- void CMovie::PasteHandleToCurrentSelection(FW_PlatformHandle newHandle, OSType handleType)
- {
- if (fMovie)
- {
- FW_CMacAcquireMultiFinderHeapZone heapZone;
- ::PasteHandleIntoMovie(newHandle, handleType, fMovie, 0, (ComponentInstance)0); // THROW_IF_ERROR
- ::MCMovieChanged(fMovieController, fMovie); // THROW_IF_ERROR
- }
- }
-
-